﻿

using System;
using System.ServiceModel;
using WCFContract;
using WCFService;



namespace WCFHost
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 文件操作简单实例

            //using (ServiceHost host = new ServiceHost(typeof(WCFService.FileOpeatorService)))
            //{
            //    if (host.State != CommunicationState.Opening)
            //    {
            //        host.Open();
            //    }

            //    foreach(var endpoint in host.Description.Endpoints)
            //    {
            //        Console.WriteLine("地址：" + endpoint.Address + "绑定：" + endpoint.Binding + "契约：" + endpoint.Contract);
            //    }

            //    Console.Read();
            //    host.Close();
            //}

            #endregion

            #region MP3文件操作实例

            using (ServiceHost host = new ServiceHost(typeof(WCFService.MP3OpeatorService)))
            {
                if (host.State != CommunicationState.Opening)
                {
                    host.Open();
                }

                foreach (var endpoint in host.Description.Endpoints)
                {
                    Console.WriteLine("地址：" + endpoint.Address + "绑定：" + endpoint.Binding + "契约：" + endpoint.Contract);
                }

                Console.Read();
                host.Close();
            }

            #endregion
        }
    }
}
